# Maintainer: Marian Buschsieweke <marian.buschsieweke@posteo.net>
pkgname=openfpgaloader
pkgver=0.11.0
pkgrel=0
pkgdesc="Universal utility for programming FPGAs"
url="https://github.com/trabucayre/openFPGALoader"
arch="all"
license="Apache-2.0"
makedepends="
	cmake
	hidapi-dev
	libftdi1-dev
	libusb-dev
	ninja
	zlib-dev
	"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/trabucayre/openFPGALoader/archive/refs/tags/v$pkgver.tar.gz
	"
builddir="$srcdir/openFPGALoader-$pkgver"

build() {
	cmake -B build -G Ninja \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		#
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest -j1
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
cffc5f9ae0ffd75c7b7954dc19e348c80c2c847141879b6dfac06efc22fc0f574d9352cbd748553275077364a2086b00af67b5ea11130a6eea3e6f32e01f3f42  openfpgaloader-0.11.0.tar.gz
"
